<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/basicdata/Bas_Machine.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basproject/basicdata/Bas_Machine.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Bas_Machine",
        setup() {
            const table = ref({
                key: "MachineId",
                footer: "Foots",
                cnName: "设备台账",
                name: "basicdata/Bas_Machine",
                newTabEdit: false,
                url: "/Bas_Machine/",
                sortName: "MachineCode,MachineTypeId"
            });
            const editFormFields = ref({"MachineTypeId":[],"MachineCode":"","MachineName":"","MachineDesc":"","Level":"","Enabled":"","MachineStatus":"","Category":"","PlantId":"","WorkshopId":"","VendorName":"","ReceiveTime":"","PositionRow":"","RelatedDevice":"","IsCe":"","MachinePicture":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"BASE_MachineTypeList","data":[],"title":"设备类型","field":"MachineTypeId","type":"cascader"},
                               {"title":"设备编码","required":true,"field":"MachineCode"}],
                              [{"title":"设备名称","required":true,"field":"MachineName"},
                               {"title":"设备描述","field":"MachineDesc","type":"textarea"}],
                              [{"title":"设备顺序","field":"Level","type":"number"},
                               {"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"switch"}],
                              [{"dataKey":"enabled","data":[],"title":"设备分类","field":"Category","type":"select"},
                               {"dataKey":"BASE_DeviceStatus","data":[],"title":"设备状态","field":"MachineStatus","type":"select"}],
                              [{"dataKey":"BASE_Plant","data":[],"title":"归属工厂","field":"PlantId","type":"select"},
                               {"dataKey":"BASE_Workshop","data":[],"title":"归属车间","field":"WorkshopId","type":"select"}],
                              [{"title":"设备厂家","field":"VendorName"},
                               {"title":"入厂时间","field":"ReceiveTime"}],
                              [{"title":"位置","field":"PositionRow","type":"number"},
                               {"dataKey":"BASE_Machine","data":[],"title":"关联设备","field":"RelatedDevice","type":"select"}],
                              [{"dataKey":"enabled","data":[],"title":"是否含ce","field":"IsCe","type":"switch"}],
                              [{"title":"设备图片","field":"MachinePicture","type":"img"},
                               {"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"MachineTypeId":[],"MachineCode":"","MachineName":"","MachineDesc":"","MachineStatus":"","Enabled":"","PlantId":"","WorkshopId":""});
            const searchFormOptions = ref([[{"dataKey":"BASE_MachineTypeList","data":[],"title":"设备类型","field":"MachineTypeId","type":"cascader"},{"title":"设备编码","field":"MachineCode","type":"like"},{"title":"设备名称","field":"MachineName","type":"like"},{"title":"设备描述","field":"MachineDesc","type":"like"}],[{"dataKey":"BASE_DeviceStatus","data":[],"title":"设备状态","field":"MachineStatus","type":"select"},{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"select"},{"dataKey":"BASE_Plant","data":[],"title":"归属工厂","field":"PlantId","type":"select"},{"dataKey":"BASE_Workshop","data":[],"title":"归属车间","field":"WorkshopId","type":"select"}]]);
            const columns = ref([{field:"MachineTypeId",title:"设备类型",type:"bigint",bind:{ key:"BASE_MachineTypeList",data:[]},width:110,fixed:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineCode",title:"设备编码",type:"string",link:true,width:120,fixed:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineName",title:"设备名称",type:"string",width:150,fixed:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineDesc",title:"设备描述",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"MachinePicture",title:"设备图片",type:"img",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"MachineStatus",title:"设备状态",type:"int",bind:{ key:"BASE_DeviceStatus",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Category",title:"设备分类",type:"int",bind:{ key:"enabled",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Level",title:"设备顺序",type:"int",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"PlantId",title:"归属工厂",type:"bigint",bind:{ key:"BASE_Plant",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Plant.PlantCode",title:"工厂编码",type:"string",width:80,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"Plant.PlantName",title:"工厂名称",type:"string",width:100,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"WorkshopId",title:"归属车间",type:"bigint",bind:{ key:"BASE_Workshop",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Workshop.WorkshopCode",title:"车间代码",type:"string",width:80,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"Workshop.WorkshopName",title:"车间名称",type:"string",width:100,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"PositionRow",title:"位置",type:"int",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"VendorName",title:"设备厂家",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"IsCe",title:"是否含ce",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ReceiveTime",title:"入厂时间",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"RelatedDevice",title:"关联设备",type:"bigint",bind:{ key:"BASE_Machine",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
